<template>
  <div class="app-content">
    <van-nav-bar title="我的学习" @click-left="$router.go(-1);" class="app-van-nav-bar">
      <x-svg-icon slot="left" name="arrow_back" />
    </van-nav-bar>
    <van-tabs v-model="active" swipeable class="app-van-tabs">
      <van-tab v-for="item in statusOptions" :title="item.label" :key="item.value">
        <list :studyFlag="item.value" />
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import list from './list.vue'
export default {
  name: 'myStudy',
  components: { list },
  data() {
    return {
      active: 0,
      statusOptions: [
        { label: '全部', value: '' },
        { label: '学习中', value: 2 },
        { label: '已学习', value: 3 },
      ],
    };
  },
  methods: {
  },
  mounted() {
    const { active } = this.$route.query;
    if (active) {
      const index = this.statusOptions.findIndex( o => o.value == active )
      this.active = index
    }
  }
};
</script>

<style lang="scss" scoped>
</style>
